﻿using Modbus;
using Model;
using PrintLabel.Tools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PrintLabel.View
{
    public partial class 注册 : AntdUI.Window
    {
        public string RegisterCode { get; set; } = string.Empty;
        public 注册(string RequestCode)
        {
            InitializeComponent();
            textBox1.Text = RequestCode;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (GetMachineCodeHelper.ValidateRegisterCode(textBox2.Text))
            {
               RegisterCode = textBox2.Text;
                this.Close();
            }
            else
            {
               ShowMessage.ShowErrorMessagebox(this, "注册码不正确，请联系管理员获取注册码！");
            }
        }
    }
}
